#pragma once

struct Timer {
	float start, end;
	bool done;
	float getTime(float dt) {
		return (dt-start);
	};
	void coolDown(float dt, float e) {
		float start;
		if(!start) {
			start = dt;
		}
		if(start > e) { 
			done = true;
		}
		else {
			done = false;
		}
	};
};

class Level
{
private:
	float levelStart, levelEnd;
	int levelNum;
	int bossState;
public:
	Level(void);
	Timer time;
	void setMinions(int num); //set how many minions there are in the level
	void setBoss(); // set boss info
	void startLevel(int num); // set level info with num of minions to load
	void endlevel(); //release level info
	void setBG(); //set background image
	void spawnMinions(int num, float t); //spawn num minions at time t
	void startBoss(float t); //spawn boss at time t
	void minionMove(int s, int e, int x, int y, float dx, float dy); //spawn minions from num s to num e at x,y pos and dx,dy direction
	void minionShoot(int s, int e, float dt);  //minion num s to e shoots at dt intervals

	void render(); //renders the whole level
	void update(float dt); //updates the whole level
	void updateMinions(); //update minions
	void updateBG(float dt); //update background
	void renderMinions(); //render minions
	void updateBoss(float dt); //update boss
	void renderBoss(); // render boss
	~Level(void);
};

